fun main(args : Array<String>){
    //if
	var a:Int = 3
	if(a > 2){
		println("a > 2")
	}else{
	}
	
	//作为表达式
	var b:Int = 4
	var c = if(a>b) a else b
	println("c=$c")
	var d = if(a<b){
		println("xxxx")
		a
	}else{
		b
	}
	println("d=$d")
	
	//结合区间
	if(a in 1..9){
		println("a in 1..9")
	}
	
	//when
	when(a){
		1 -> print("")
		2 -> print("")
		3 -> println("When a == 3")
		else -> print("")
	}
	
	when(a){
		1,3,5 -> println("when a in 1,3,5")
		else -> print("")
	}
	
	when(a){
		in 1..10 -> println("when a in 1..10")
		!in 10..20 -> println("when a not in 10..20")
		else -> print("")
	}
	
	var e = "China"
	when(e){
		is String -> println("e is String")
		else -> println("e is not String")
	}
	
	when{
		xx() -> println("xx is true")
		else -> println("xx is not true")
	}
	
}

fun xx() = false